-
Notifications
You must be signed in to change notification settings - Fork 3
add structlog to dspace refactor #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hakbailey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments about what did and didn't work for me when I tried to run this. @gravesm will probably have a better explanation for why those things happened...
| def main(ctx, url, email, password): | ||
| ctx.obj = {} | ||
| print('Application start') | ||
| structlog.configure(processors=[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to remove this entire block and it logged fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you getting 2019-11-26 13:39.16 Application start or {"event": "Application start", "logger": "__main__", "level": "info", "timestamp": "2019-11-26T18:40:30.819933Z"}? I just commented it out again and I'm still having the same problem where it gives me unstructured log entries in the terminal but nothing to the file
0a55c76 to
535e0ce
Compare
|
I would hold off on adding the config block. I am indeed seeing the unstructured message without it, but based on my understanding of structlog that seems wrong. We should take the time to understand what's going on before adding code just to make it work. |
|
OK, I'll pull it back |
|
And for the record, this is where I found the code that I'm adapting https://structlog.readthedocs.io/en/16.1.0/standard-library.html#suggested-configuration |
b08c87b to
88ab8dd
Compare
5ea8265 to
b43188f
Compare
|
Updated |
What does this PR do?
Adding structlog. For some reason, I had to add the config code block (lines 23-32) to get the desired output even though I didn't need to add that code block to my ArchivesSpace code. I did a lot of testing/comparison to no avail to but I may be adding a similar code block to the ArchivesSpace code in case there is some weird local thing that is triggering the structlog config in the ArchivesSpace repo.
Includes new or updated dependencies?
YES